<!-- 进度条 -->
<template>
  <div
    class="progress-all"
    :style="{
      height: trackHeight + 'px',
      lineHeight: trackHeight + 'px',
      background: trackColor,
      borderRadius: trackHeight + 'px',
    }"
  >
    <div
      class="progress-a"
      :style="{
        height: trackHeight + 'px',
        width: percentage + '%',
        background: pivotColor,
        borderRadius: trackHeight + 'px',
        fontSize: textSize + 'px',
      }"
    >
      {{ pivotText || percentage + "%" }}
    </div>
  </div>
</template>

<script>
export default {
  props: {
    trackColor: {
      // 轨道颜色
      type: String,
    },
    trackHeight: {
      // 轨道高度
      type: String,
    },
    pivotColor: {
      // 进度条颜色
      type: String,
    },
    pivotText: {
      type: String,
    },
    textColor: {
      type: String,
    },
    percentage: {
      // 进度百分比
      type: Number,
      default: "0%",
    },
    trackRadius: {
      // 轨道圆角
      type: String,
    },
    textSize: {
      type: String,
    },
  },
};
</script>

<style lang="scss" scoped>
.progress-all {
  font-size: 8px;
  width: 100%;
  background: #e5e5e5;
  border-radius: 5px;
  box-sizing: border-box;
  height: 8px;
  line-height: 8px;
  .progress-a {
    font-size: 8px;
    border-radius: 5px;
    background: #1989fa;
    padding: 0 5px 0 0;
    text-align: right;
    color: #fff;
  }
}
</style>